Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReadInt and ReadLong eof #380

Closed
wants to merge 1 commit into from

Conversation

brianshih1
Copy link
Contributor

My intuition is that if the reader tries to ReadInt or ReadLong and it encounters an EOF before the end of the int/long, then it should be an error. In that case, we should wrap the EOF error.

However, after this PR's change, two tests are failing: TestDecoder_SkipRef and TestDecoder_DecodeEOFDoesntReturnError.

func TestDecoder_DecodeEOFDoesntReturnError(t *testing.T) {
	defer ConfigTeardown()

	data := []byte{0xE2}
	schema := "int"
	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))

	var i int
	err := dec.Decode(&i)

	assert.NoError(t, err)
}

Is my assumption correct? And in that case what should we do with these tests?

@brianshih1 brianshih1 closed this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant